package partTwo;
class Outter2 {
    String outer = "outerstring";
    static String outerStatic = "outerstaticstring";
    private String outerPrivate = "outerprivatestring";
    public String getOuterPrivate() {
        return outerPrivate;
    }
    public void setOuterPrivate(String outerPrivate) {
        this.outerPrivate = outerPrivate;
    }

    //方法中的局部内部类
    public void outerFind() {
        System.out.println("outer...find");
        //普通局部内部类
        //static class Inner2 {
        class Inner2 {
            String inner = "inner";
            //static String innerstatic = "staticinner";
            private String innerPrivate = "innerprivate";
            public void innerFind() {
                System.out.println("inner...find");
                System.out.println("局部内部类可以使用外部类的全部资源"+outer);
                System.out.println("局部内部类可以使用外部类的全部资源"+outerStatic);
                System.out.println("局部内部类可以使用外部类的全部资源"+outerPrivate);
                //outerFind(); //这里要注意，方法直接的互相调用会导致死循环
                innerPrivateFind();
            }
            //static public void innerStaticFind() {System.out.println("inner...static...find");}
            private void innerPrivateFind() {
                System.out.println("inner...private....find");
            }
        }

        Inner2 inner2 = new Inner2();
        System.out.println("在方法中创建内部类对象调用内部类资源"+inner2.inner);
        System.out.println("在方法中创建内部类对象调用内部类资源"+inner2.innerPrivate);
        inner2.innerFind();
        inner2.innerPrivateFind();
    }

}
